package algorithm;

import java.util.Scanner;

/**
 * 求斐波那契数列的某一项:f(n+2) = f(n) + f(n+1)
 *
 * @author luoyalan
 * @date 2018/7/21
 */
public class Fibonaqie {

    public static int getFibonaqieIndexN(int index) {
        if (index == 0) {
            return 1;
        }
        if (index == 1) {
            return 1;
        }
        return getFibonaqieIndexN(index - 1) + getFibonaqieIndexN(index - 2);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = Integer.valueOf(scanner.next());
        System.out.println(getFibonaqieIndexN(n));
    }
}

